# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daurnimator <daurnimator@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>

pkgname=yq
pkgver=3.2.3
pkgrel=1
pkgdesc="Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents"
arch=('any')
url="https://github.com/kislyuk/yq"
license=('Apache')
depends=('jq'
         'python-argcomplete'
         'python-tomlkit'
         'python-xmltodict'
         'python-yaml')
makedepends=('python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
conflicts=('go-yq')
source=("https://files.pythonhosted.org/packages/source/y/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('29c8fe1d36b4f64163f4d01314c6ae217539870f610216dee6025dfb5eafafb1')
b2sums=('b0c4548efa08aecc98b77b5988e5dbf652951ecfab3ab01bfbf9610151cee3c3a0b9c3139434cba3bfc08a2176a617a2c9d19c0fcf47bb8a6d3cc3886fa5de6d')

build() {
  cd $pkgname-$pkgver
  python -m build -wn
}

check() {
  cd $pkgname-$pkgver
  python test/test.py
}

package() {
  cd $pkgname-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
}
